<?php
/*
 * 手机客户端 展品明细
 * 2013-12-04
 */
 
include "inc/public_header.php";

include "func/user.php";				//用户信息处理函数


$reJson = array(); //构建返回值
$reJson["success"]='1';


//页数，第一页为0
$page			= $_REQUEST["page"]; 
//每页记录数			
$pagesize		= $_REQUEST["pagesize"];

//图片地址
$IMG_DEFAULT_PATH = "http://www.chinalaohu.com/images/news/";

if(!isset($page)){
	$page = 0;
}
if(!isset($pagesize)){
	$pagesize = 10; //默认每页10条
}
$sql="select count(id) as ct from article_info where cid=1";
$db->query($sql);
$db->next_record();
$reJson["count"] = $db->f("ct");


$sql="SELECT id,aname,istime,aindex,img,content from article_info WHERE cid=1 order by istime desc";
$sql = $sql." limit ".($page * $pagesize).",".$pagesize;
$db->query($sql);


$news = array();
while($db->next_record()){
		if($db->f("img")){
		
	$news[]=array(
		"name"=>$db->f("aname")
		,"date"=>$db->f("istime")
		,"imgUrl"=>$IMG_DEFAULT_PATH.$db->f("img")
		,"content"=>(string)$db->f("content")
		,"url"=>"http://adio.chinalaohu.com/app/doc/news".$db->f("id").".html"
		// ,"url"=>"http://adio.tigeronline.cn/app/doc/cupshelp.html"
	);
	}else{
	$news[]=array(
		"name"=>$db->f("aname")
		,"date"=>$db->f("istime")
		//,"imgUrl"=>$db->f("img")
		,"content"=>(string)$db->f("content")
		,"url"=>"http://adio.chinalaohu.com/app/doc/news".$db->f("id").".html"
		// ,"url"=>"http://adio.tigeronline.cn/app/doc/cupshelp.html"
	);
	}
	
}
$reJson["list"]=$news;

echo json_encode($reJson);

 ?>